﻿using System;
using System.Collections.Generic;
using System.Text;
using NExt.Core.Model.Base;

namespace NExt.UI.Base.Js
{
    public class ExternalJs: IScript
    {
        private readonly string script;
        private const string SCRIPT_FORMAT = "function(){{this.parent.{0}();}}";

        public ExternalJs(string functionName)
        {
            script = string.Format(SCRIPT_FORMAT, functionName);
        }

        public string text
        {
            get { return script; }
        }
    }
}
